<div class="sub-main-container">
    <div class="search-wrap">
        <form nz-form [nzLayout]="'inline'" [formGroup]="searchForm">
            <nz-form-item>
                <nz-form-label>时间范围</nz-form-label>
                <nz-form-control>
                    <nz-range-picker formControlName="rangePickerTime" nzShowTime [nzPlaceHolder]="['起始日期', '截止日期']">
                    </nz-range-picker>
                </nz-form-control>
            </nz-form-item>
            <nz-form-item>
                <nz-form-label>关键字</nz-form-label>
                <nz-form-control>
                    <input formControlName="keywords" nz-input placeholder="关键字" />
                </nz-form-control>
            </nz-form-item>
            <nz-form-item>
                <nz-form-control>
                    <button nz-button nzType="primary" (click)="queryInfo(true)"><i nz-icon nzType="search"></i>查询
                    </button>
                </nz-form-control>
            </nz-form-item>
        </form>
        <button nz-button nzType="danger" class="add-btn" (click)="openEditModal()">
            <i nz-icon nzType="plus" nzTheme="outline"></i>新增
        </button>
    </div>

    <div class="main-wrap">
        <nz-table #dataTable class="main-table" [nzData]="tableData" [nzTotal]="total" [nzFrontPagination]="false"
            [(nzPageIndex)]="pageNum" [(nzPageSize)]="pageSize" [nzLoading]="loading" (nzPageIndexChange)="queryInfo()"
            nzBordered nzSize="middle">
            <thead>
                <tr>
                    <th>编号</th>
                    <th>考核类别</th>
                    <th>考核人</th>
                    <th>被考核人</th>
                    <th>考核时间</th>
                    <th>考核方式</th>
                    <th>考核结果</th>
                    <!--<th>附件</th>-->
                    <th>备注</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                <tr *ngFor="let data of dataTable.data">
                    <td>{{data.code}}</td>
                    <td>{{data.checkType}}</td>
                    <td>{{data.checkUser}}</td>
                    <td>{{data.user}}</td>
                    <td>{{data.checkTime}}</td>
                    <td>{{data.checkMethod}}</td>
                    <td>{{data.result}}</td>
                    <!--<td>{{ data.fileName }}</td>-->
                    <td>{{data.remark}}</td>
                    <td>
                        <a (click)="openEditModal(false, data)">详情</a>
                        <nz-divider nzType="vertical"></nz-divider>
                        <a (click)="openEditModal(true, data)">编辑</a>
                        <nz-divider nzType="vertical"></nz-divider>
                        <a nz-popconfirm nzPopconfirmTitle="确认删除？" nzPopconfirmPlacement="left"
                            (nzOnConfirm)="onDelete(data.id)">
                            删除
                        </a>
                    </td>
                </tr>
            </tbody>
        </nz-table>
    </div>

    <nz-modal nzClassName="custom-modal sf-education-modal" nzWidth="760" [nzFooter]="queryType"
        [(nzVisible)]="modalShow" [nzTitle]="modalTitle" (nzOnCancel)="onCancel()" (nzOnOk)="onConfirm()">
        <form nz-form [formGroup]="form">
            <div nz-row [nzGutter]="24">
                <div nz-col [nzSpan]="12">
                    <nz-form-item nzFlex>
                        <nz-form-label [nzSpan]="6">编号</nz-form-label>
                        <nz-form-control [nzSpan]="16">
                            <input nz-input formControlName="code" placeholder="编号">
                        </nz-form-control>
                    </nz-form-item>
                </div>
                <div nz-col [nzSpan]="12">
                    <nz-form-item nzFlex>
                        <nz-form-label [nzSpan]="6">考核类别</nz-form-label>
                        <nz-form-control [nzSpan]="16">
                            <input nz-input formControlName="checkType" placeholder="考核类别">
                        </nz-form-control>
                    </nz-form-item>
                </div>
                <div nz-col [nzSpan]="12">
                    <nz-form-item nzFlex>
                        <nz-form-label [nzSpan]="6">考核人</nz-form-label>
                        <nz-form-control [nzSpan]="16">
                            <input nz-input formControlName="checkUser" placeholder="考核人">
                        </nz-form-control>
                    </nz-form-item>
                </div>
                <div nz-col [nzSpan]="12">
                    <nz-form-item nzFlex>
                        <nz-form-label [nzSpan]="6">被考核人</nz-form-label>
                        <nz-form-control [nzSpan]="16">
                            <input nz-input formControlName="user" placeholder="被考核人">
                        </nz-form-control>
                    </nz-form-item>
                </div>
                <div nz-col [nzSpan]="12">
                    <nz-form-item nzFlex>
                        <nz-form-label [nzSpan]="6">考核时间</nz-form-label>
                        <nz-form-control [nzSpan]="16">
                            <nz-date-picker formControlName="checkTime" nzShowTime nzFormat="yyyy-MM-dd HH:mm:ss"
                                nzPlaceHolder="考核时间"></nz-date-picker>
                        </nz-form-control>
                    </nz-form-item>
                </div>
                <div nz-col [nzSpan]="12">
                    <nz-form-item nzFlex>
                        <nz-form-label [nzSpan]="6">考核方式</nz-form-label>
                        <nz-form-control [nzSpan]="16">
                            <input nz-input formControlName="checkMethod" placeholder="考核方式">
                        </nz-form-control>
                    </nz-form-item>
                </div>
                <div nz-col [nzSpan]="24">
                    <nz-form-item nzFlex>
                        <nz-form-label [nzSpan]="3">考核结果</nz-form-label>
                        <nz-form-control [nzSpan]="20">
                            <textarea formControlName="result" nz-input rows="2"></textarea>
                        </nz-form-control>
                    </nz-form-item>
                </div>
                <div nz-col [nzSpan]="24">
                    <nz-form-item nzFlex>
                        <nz-form-label [nzSpan]="3">备注</nz-form-label>
                        <nz-form-control [nzSpan]="20">
                            <textarea formControlName="remark" nz-input rows="2"></textarea>
                        </nz-form-control>
                    </nz-form-item>
                </div>
                <div nz-col [nzSpan]="22" [nzOffset]="1" style="padding-bottom: 20px;">
                    <nz-upload nzType="drag" [nzMultiple]="true" [(nzFileList)]="fileList"
                        [nzDisabled]="fileUploadDisabled" (nzChange)="handleChange($event)" [nzAction]="uploadUrl">
                        <p class="ant-upload-drag-icon">
                            <i nz-icon nzType="inbox"></i>
                        </p>
                        <p class="ant-upload-text">点击或者拖拽文件到此处上传</p>
                    </nz-upload>
                </div>
            </div>
        </form>
    </nz-modal>

</div>